package com.myworkbench.workbench.domain.entity.role;

import com.myworkbench.workbench.domain.Command;
import com.myworkbench.workbench.domain.entity.resource.Resource;
import com.myworkbench.workbench.domain.entity.user.User;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;

@Entity
@Table(name = "rel_role_resource")
@AllArgsConstructor
@NoArgsConstructor
public class RelRoleResource extends Command implements Serializable {

    @EmbeddedId
    @ManyToOne(cascade = CascadeType.REFRESH)
    @JoinColumn(name = "ROLE_ID")
    private Role role;
    @EmbeddedId
    @ManyToOne(cascade = CascadeType.REFRESH)
    @JoinColumn(name = "RESOURCE_ID")
    private Resource resource;

}
